'use strict';

const Service = require('egg').Service;

class NamesesService extends Service {
    async find(key) {
        let sql = `SELECT * FROM synopsis_other WHERE id ="${key}"`;
        const data = await this.app.mysql.query(sql);
        return {data};
      }

      async findName(key) {
        let sql = `SELECT * FROM synopsis_other WHERE nameOther Like "%${key}%"`;
        const data = await this.app.mysql.query(sql);
        return {data};
      }
      async findAll(){
        let sql = `SELECT * FROM synopsis_other`;
        const data = await this.app.mysql.query(sql);
        return {data};
      }
}

module.exports = NamesesService;
